﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAO;
using DTO;
using System.ComponentModel;
using System.Data;

namespace BUS
{
    public class PhongChieuBUS
    {
        public static List<RapChieu> layDSRap()
        {
            List<RapChieu> dsRap;
            dsRap = PhongChieuDAO.layDSRap();
            return dsRap;
        }
        public static List<DinhDangPhim> layDSDieuKienKT()
        {
            List<DinhDangPhim> dsDieuKienKT;
            dsDieuKienKT = PhongChieuDAO.layDSDieuKienKT();
            return dsDieuKienKT;
        }

        public static List<TinhTrangPhong> layDSTinhTrangPhong()
        {
            List<TinhTrangPhong> dsTinhTrangPhong;
            dsTinhTrangPhong = PhongChieuDAO.layDSTinhTrangPhong();
            return dsTinhTrangPhong;
        }

        public static BindingList<PhongChieu> getDSPhongChieuByMaRap(string maRap)
        {
            BindingList<PhongChieu> dsPC = PhongChieuDAO.getDSPhongByMaRap(maRap);
            return dsPC;
        }

        public static int ThemPhongChieu(PhongChieu pc)
        {
            int kq = -1;
            kq = PhongChieuDAO.themPhongChieu(pc);
            return kq;
        }

        public static int capNhatPhong(PhongChieu pc)
        {
            int kq = -1;
            kq = PhongChieuDAO.capNhatPhong(pc);
            return kq;
        }

        //LẤY DANH SÁCH PHÒNG ĐỂ LOAD LÊN COMBOBOX TRONG FRMDANGKY_SUATCHIEU
        public static DataTable Load_DSPhong_TheoDinhDangPhim(int MDD)
        {
            DataTable dt = new DataTable();
            dt = PhongChieuDAO.Lay_DS_Phong_THEODINHDANGPHIM(MDD);
            return dt;
        }
    }
}
